package top.tangyh.lamp.care.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import top.tangyh.basic.base.mapper.SuperMapper;
import top.tangyh.lamp.care.entity.BCareRecordsConfigNew;
import org.springframework.stereotype.Repository;
import top.tangyh.lamp.care.vo.result.BCareRecordsConfigNewResultVO;
import top.tangyh.lamp.common.constant.CommonConstant;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * 新版本护理记录表单配置表
 * </p>
 *
 * @author zqb
 * @date 2024-08-05 15:12:19
 * @create [2024-08-05 15:12:19] [zqb] [代码生成器生成]
 */
@Repository
public interface BCareRecordsConfigNewMapper extends SuperMapper<BCareRecordsConfigNew> {


    /**
     * 根据父id查询所有父id下面的子对象信息
     * @param pid
     * @return
     */
    List<BCareRecordsConfigNew> getIdObjectByPid(Long pid);


    List<BCareRecordsConfigNewResultVO> noteTreeNew();

    /**
     * @Description:  获取 多个模块中 最早的那个 有数据的时间
     * @Param:
     * @return:
     * @Author: Mr.zqb
     * @Date: 2022/1/25
     */
    String getMinRecordTimeByParamNew(String hospitalNumber, String rkDate, String cyDate, List<String>  dictValues);


    default List<BCareRecordsConfigNew> selectObsvCode(){
        LambdaQueryWrapper<BCareRecordsConfigNew> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.isNotNull(BCareRecordsConfigNew::getObsvCode).eq(BCareRecordsConfigNew::getIsDeleted, CommonConstant.NO_NUMBER);
        return selectList(queryWrapper);
    }

    default List<BCareRecordsConfigNew> selectPg(){
        LambdaQueryWrapper<BCareRecordsConfigNew> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.isNotNull(BCareRecordsConfigNew::getPgId).eq(BCareRecordsConfigNew::getIsDeleted, CommonConstant.NO_NUMBER);
        return selectList(queryWrapper);
    }

    default List<BCareRecordsConfigNew> selectVteBarden(){
        LambdaQueryWrapper<BCareRecordsConfigNew> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.isNotNull(BCareRecordsConfigNew::getDictValue).eq(BCareRecordsConfigNew::getIsDeleted, CommonConstant.NO_NUMBER)
                .eq(BCareRecordsConfigNew::getDictValue,"vte_braden");
        return selectList(queryWrapper);
    }

    default List<BCareRecordsConfigNew> selectVteAdd(){
        LambdaQueryWrapper<BCareRecordsConfigNew> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.isNotNull(BCareRecordsConfigNew::getDictValue).eq(BCareRecordsConfigNew::getIsDeleted, CommonConstant.NO_NUMBER)
                .eq(BCareRecordsConfigNew::getDictValue,"vte_dd");
        return selectList(queryWrapper);
    }

    default List<BCareRecordsConfigNew> selectHlcz(){
        LambdaQueryWrapper<BCareRecordsConfigNew> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.isNotNull(BCareRecordsConfigNew::getDictValue)
                .eq(BCareRecordsConfigNew::getDictValue,"hlcz").eq(BCareRecordsConfigNew::getIsDeleted, CommonConstant.NO_NUMBER)
                .isNotNull(BCareRecordsConfigNew::getItemCode);
        return selectList(queryWrapper);
    }
    
}


